/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package projekt;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author ADAM
 */
public class DNAData extends Data
{
    private int mIdOrganizmu;
    public DNAData(GetData mPobieranieDanych,int pmIdOrganizmu) {
        super(mPobieranieDanych);
        this.mIdOrganizmu = pmIdOrganizmu;
        mData = new ArrayList();
    }

    @Override
    public List<List<String>> getAllData() {
        return mData;
    }

    @Override
    public void setAllData(List pmList) {
        mData = new ArrayList<>(pmList);
    }

    @Override
    public void addData(List<String> pmItem)
    {
        mData.add(pmItem);
    }

    @Override
    public List<String> getData(int pmIndex) {
        if(pmIndex < getSize())
        {
            return mData.get(pmIndex);
        }else
        {
            return null;
        }
    }

    @Override
    public int getSize() {
        return mData.size();
    }

    @Override
    public boolean downloadData() 
    {
        List<String> lvItem = mPobieranieDanych.pobierzDane(mIdOrganizmu);
        if(lvItem == null)
        {
            return false;
        }else
        {
            mData.add(lvItem);
            return true;
        }
    }
    

    
    
    
    
    
}
